package com.lch.designpattern.factory.abstractfactory;

/**
 * @author: liuchenhui
 * @create: 2019-04-14 20:18
 **/
public class IFactoryTest {
    public static void main(String[] args) {
        IFactory factory = new BenzFactory();
        factory.createEngine().make();
        factory.createTyre().make();
        factory.createCar().driveCar();

        System.out.println("");

        factory = new BMWFactory();
        factory.createTyre().make();
        factory.createEngine().make();
        factory.createCar().driveCar();
    }
}